package ControleurBelote;


//
// IUT de Nice / Departement informatique / Module APO-Java
// Annee 2011_2012 - Composants generiques
//
// Classe EspionG - Espion d'evenements 
//
// Edition A    : externalisation depuis les controleurs de panneaux et de 
//                barre de menus 
//
//    + Version 1.0.0	: couverture des besoins initiaux des controleurs
//                        des classes PanneauG et BarreMenusG
//
// Auteur : A. Thuaire
//

import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.util.LinkedList;
  
public class EspionG {
private LinkedList  events= new LinkedList();
private boolean     statusEventsTracker= false;          
   
// ---                                            Methode startEventsTracker
   
   public void startEventsTracker () {statusEventsTracker= true;}
   
// ---                                             Methode stopEventsTracker
   
   public void stopEventsTracker () {statusEventsTracker= false;}
   
// ---                                                     Methode getEvents
   
   public LinkedList getEvents () {return events;}
   
// ---                                                   Methode resetEvents
   
   public void resetEvents () {events= new LinkedList();}
   
// ---                                      Methode interface ActionListener

   public void actionPerformed (ActionEvent e) {
  
      if (statusEventsTracker) events.add(e);
   }   
   
// ---                                      Methodes interface MouseListener
   
   public void mouseClicked  (MouseEvent e) {
     
      if (statusEventsTracker) events.add(e);
   }
   
   public void mouseEntered  (MouseEvent e) {}
   public void mouseExited   (MouseEvent e) {}
   public void mousePressed  (MouseEvent e) {}                  
   public void mouseReleased (MouseEvent e) {}                           

// ---                                Methodes interface MouseMotionListener                              
  
   public void mouseMoved    (MouseEvent e) {}                    
   public void mouseDragged  (MouseEvent e) {}  
} 
